#ifndef ITEXTURE_H_INCLUDED
#define ITEXTURE_H_INCLUDED

#include "GLOBAL.h"
//#include "Texel.h"

///
enum eTEXEL_FORMATS {
	eTF_JUST_DONT = 0,
	eTF_RGBA32 = 1,
	eTF_RGB24,
	eTF_X8,
	eTF_RGBA16F,
	eTF_DEPTH24,
	eTF_DEPTH
};

/// Abstract Texture Interface
class ITexture {
protected:

protected:
	static const long m_DefaultFlags = eDBF_VRAM | eDBF_STATIC;

	int		m_iWidth;		///< Texture Width
	int		m_iHeight;		///< Texture Height
	long  	m_lFlags;		///< Texture Usage Flags
	int  	 	m_iFormat;		///< Texture Format
	byte*		m_RAMData;		///< Data in RAM

	#ifdef TZM_BUILD_SAFEMODE
		bool m_bInvalid;
	#endif


public:
	virtual void Bind( ui16 stage ) = 0;

			   // Constructor & Destructor
			   ITexture( int w, int h, byte* data, int format = eTF_X8, int flags = eDBF_DEFAULT_SETTINGS )
				: m_iWidth(w), m_iHeight(h), m_lFlags(flags), m_iFormat(format), m_RAMData(NULL)
				#ifdef TZM_BUILD_SAFEMODE
					, m_bInvalid( true )
				#endif
				{
					if ( !m_lFlags )
						m_lFlags = m_DefaultFlags;
					if ( m_lFlags & eDBF_RAM )
						m_RAMData = data;
				}
	virtual ~ITexture( ) {
					FREEA( m_RAMData );
				}
};

#endif // ITEXTURE_H_INCLUDED
